VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "StackNode"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private vm_stackData_obj As Variant
Private vm_NextItem_obj As StackNode

Public Sub initWithDataAndNext(ByVal obj As Variant, ByVal nextItem As StackNode)
If IsObject(obj) Then Set vm_stackData_obj = obj Else vm_stackData_obj = obj
Set vm_NextItem_obj = nextItem
End Sub

Public Sub initWithObject(ByVal obj As Variant)
initWithDataAndNext obj, Nothing
End Sub

Public Property Get stackData() As Variant
Attribute stackData.VB_UserMemId = 0
If IsObject(vm_stackData_obj) Then
    Set stackData = vm_stackData_obj
Else
    stackData = vm_stackData_obj
End If
End Property

Public Property Get nextItem() As StackNode
Set nextItem = vm_NextItem_obj
End Property

Friend Property Set nextItem(ByVal pr_NewNode As StackNode)
Set vm_NextItem_obj = pr_NewNode
End Property

Private Sub Class_Initialize()
cleanUpObjects
End Sub

Private Sub Class_Terminate()
cleanUpObjects
End Sub

Private Sub cleanUpObjects()
Set vm_NextItem_obj = Nothing
Set vm_stackData_obj = Nothing
End Sub

Public Function shallowClone() As StackNode
Dim vl_NewNode As StackNode

Set vl_NewNode = New StackNode
vl_NewNode.initWithDataAndNext Me.stackData, Me.nextItem
End Function
